GtkColorEditor: Keep ref on pre-popup focus widget
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 21 Jun 2016 11:57:20 +0000 (13:57 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 21 Jun 2016 15:56:34 +0000 (17:56 +0200)
commitf44b9ef1f0b9bce88f01b258714338a9006f60e1
tree865e964539230f55d34a5bb0738aca8406e16ee3
parent3b98a2d93596aac73efa91a04042b66fda8ec823
GtkColorEditor: Keep ref on pre-popup focus widget

And ensure it's still visible before returning the keyboard focus to it.
Because of the extra ref, add a dispose handler that will ensure the
ref is lost (by popping down), although this should be already ensured
through other paths (eg. when the popup widget loses visibility).

This fixes a possible crash in dispose paths, where we might be restoring
focus on an already destroyed widget, and at a time where, if the toplevel
is being itself disposed, no new focus should be set.

https://bugzilla.gnome.org/show_bug.cgi?id=767849
gtk/gtkcoloreditor.c